// 应用api
import { requestHasToken, request } from '../util/server';

// 登录接口
export function login (admin) {
  return request({
    url: '/auth/user/login',
    method: 'post',
    data: admin
  })
}
// 获取管理员的基本信息
export function getAdmin (username) {
  return requestHasToken({
    url: '/user/' + username,
    method: 'get'
  })
}
// 修改管理员密码
export function updatePassword (data) {
  return requestHasToken({
    url: '/user/password',
    method: 'put',
    data
  })
}
// 上传图片
export function uploadImage (imgBase) {
  return requestHasToken({
    url: '/upload/img',
    method: 'post',
    data: {
      imgBase
    }
  })
}
// 请求管理员列表
export function getAdmins (data) {
  return requestHasToken({
    url: '/user/list',
    method: 'post',
    data
  })
}
// 新增管理员
export function addAdmin (user) {
  return requestHasToken({
    url: '/user',
    method: 'post',
    data: user
  })
}
// 修改管理员状态
export function updateAdminStatus (user) {
  return requestHasToken({
    url: '/user/enable',
    method: 'put',
    data: user
  })
}
// 修改管理员信息
export function updateAdminInfo (user) {
  return requestHasToken({
    url: '/user',
    method: 'put',
    data: user
  })
}
// 重置管理员密码
export function resetPassword (username) {
  return requestHasToken({
    url: '/user/password/reset',
    method: 'put',
    data: {
      username
    }
  })
}
// 添加系统消息
export function addSysMessage (msg) {
  return requestHasToken({
    // url: '/system/info',
    url: '/system/insertInfo',
    method: 'post',
    data: msg
  })
}
// 获取哦系统消息列表
export function getSysMessage (data) {
  return requestHasToken({
    url: '/system/info/list',
    method: 'post',
    data
  })
}
//  删除系统消息
export function deleteSysMessage (questionId) {
  return requestHasToken({
    url: '/system/deleteInfo/' + questionId,
    method: 'delete'
  })
}
// 获取服务类消息列表
export function getServiceMsgList (data) {
  return requestHasToken({
    url: '/service/info/list',
    method: 'post',
    data
  })
}
// 新建服务类消息模板
export function addServiceMsgTemplate (data) {
  return requestHasToken({
    url: '/service/info/template',
    method: 'post',
    data
  })
}
// 获取服务类消息模板列表
export function getServiceMsgTemplateList (data) {
  return requestHasToken({
    url: '/service/info/template/list',
    method: 'post',
    data
  })
}
// 获取服务类消息模板列表(不分页)
export function getAllServiceMsgTemplate () {
  return requestHasToken({
    url: '/service/info/template/list',
    method: 'get'
  })
}
// 修改服务类消息模板
export function updateServiceMsgTemplate (data) {
  return requestHasToken({
    url: '/service/info/template',
    method: 'put',
    data
  })
}
// 查询标签问题
export function getLabelQuestionList (data) {
  return requestHasToken({
    url: '/label/question/list',
    method: 'post',
    data
  })
}
// 按类型查询标签问题(不分页)
export function getAllQuestion (type) {
  return requestHasToken({
    url: '/label/questions',
    method: 'post',
    data: {
      type
    }
  })
}
// 添加标签问题
export function addLabelQuestion (data) {
  return requestHasToken({
    url: '/label/question',
    method: 'post',
    data
  })
}
// 删除标签问题
export function deleteLabelQuestion (id) {
  return requestHasToken({
    url: '/label/question/' + id,
    method: 'delete'
  })
}
// 更新标签问题
export function updateLabelQuestion (data) {
  return requestHasToken({
    url: '/label/question',
    method: 'put',
    data
  })
}
// 添加症状
export function addSymptom (symptom) {
  return requestHasToken({
    url: '/symptom',
    method: 'post',
    data: symptom
  })
}
// 修改症状
export function updateSymptom (data) {
  return requestHasToken({
    url: '/symptom',
    method: 'put',
    data
  })
}
// 删除症状
export function deleteSymptom (id) {
  return requestHasToken({
    url: '/symptom/' + id,
    method: 'delete'
  })
}
// 获取症状列表
export function getSymptomList (data) {
  return requestHasToken({
    url: '/symptom/list',
    method: 'post',
    data
  })
}
// 获取症状列表不分页
export function getAllSymptom () {
  return requestHasToken({
    url: '/symptom/list',
    method: 'get'
  })
}
// 获取描述
export function getDescription (data) {
  return requestHasToken({
    url: '/description/list',
    method: 'post',
    data
  })
}
// 获取描述列表不分页
export function getAllDescription () {
  return requestHasToken({
    url: '/description/list',
    method: 'get'
  })
}
// 添加描述
export function addDescription (description) {
  return requestHasToken({
    url: '/description',
    method: 'post',
    data: description
  })
}
// 删除描述
export function deleteDescription (id) {
  return requestHasToken({
    url: '/description/' + id,
    method: 'delete'
  })
}
// 修改描述
export function updateDescription (data) {
  return requestHasToken({
    url: '/description',
    method: 'put',
    data
  })
}
// 获取缺乏症列表
export function getLackList (data) {
  return requestHasToken({
    url: '/ageusia/list',
    method: 'post',
    data
  })
}
// 获取缺乏症列表不分页
export function getAllLackList () {
  return requestHasToken({
    url: '/ageusia/list',
    method: 'get'
  })
}
// 新建缺乏症
export function addLack (ageusia) {
  return requestHasToken({
    url: '/ageusia',
    method: 'post',
    data: ageusia
  })
}
// 删除缺乏症
export function deleteLack (id) {
  return requestHasToken({
    url: '/ageusia/' + id,
    method: 'delete'
  })
}
// 修改缺乏症
export function updateLack (data) {
  return requestHasToken({
    url: '/ageusia',
    method: 'put',
    data
  })
}
// 获取结果
export function getResultList (data) {
  return requestHasToken({
    url: '/result/list',
    method: 'post',
    data
  })
}
// 结果列表不分页
export function getAllResultList () {
  return requestHasToken({
    url: '/result/list',
    method: 'get'
  })
}
// 新增结果
export function addResult (result) {
  return requestHasToken({
    url: '/result',
    method: 'post',
    data: {
      result
    }
  })
}
// 删除结果
export function deleteResult (id) {
  return requestHasToken({
    url: '/result/' + id,
    method: 'delete'
  })
}
// 修改结果
export function updateResult (data) {
  return requestHasToken({
    url: '/result',
    method: 'put',
    data
  })
}
// 添加食谱
export function addRecipe (data) {
  return requestHasToken({
    url: '/recipes',
    method: 'post',
    data
  })
}
// 查询食谱列表
export function getRecipeList (data) {
  return requestHasToken({
    url: '/recipes/list',
    method: 'post',
    data
  })
}
// 修改食谱
export function updateRecipe (data) {
  return requestHasToken({
    url: '/recipes',
    method: 'put',
    data
  })
}
// 新建存储空间
export function addRoom (data) {
  return requestHasToken({
    url: '/pic/setting',
    method: 'post',
    data
  })
}
// 获取存储空间列表
export function getRoomList (data) {
  return requestHasToken({
    url: '/pic/setting/list',
    method: 'post',
    data
  })
}
// 修改存储空间列表
export function updateRoom (data) {
  return requestHasToken({
    url: '/pic/setting',
    method: 'put',
    data
  })
}
// 获取存储空间销售列表
export function getRoomSaleList (data) {
  return requestHasToken({
    url: '/wechat/user/ram/record/list',
    method: 'post',
    data
  })
}
// 新增健康规则设置
export function addHealthRule (data) {
  return requestHasToken({
    url: '/health/evaluation/setting',
    method: 'post',
    data
  })
}
// 获取健康规则列表
export function getHealthRuleList (data) {
  return requestHasToken({
    url: '/health/evaluation/setting/list',
    method: 'post',
    data
  })
}
// 新建z评分结果关系
export function addZPointResult (data) {
  return requestHasToken({
    url: '/zpoint/result',
    method: 'post',
    data
  })
}
// 删除z评分结果关系
export function deleteZPointResult (id) {
  return requestHasToken({
    url: '/zpoint/result/' + id,
    method: 'delete'
  })
}
// 修改z评分结果关系
export function updateZPointResult (data) {
  return requestHasToken({
    url: '/zpoint/result',
    method: 'put',
    data
  })
}
// 查询z评分结果列表
export function getZPointResultList (data) {
  return requestHasToken({
    url: '/zpoint/result/list',
    method: 'post',
    data
  })
}
// 查询结果症状关系列表
export function getResultSymptomList (data) {
  return requestHasToken({
    url: '/result/symptom/relation/list',
    method: 'post',
    data
  })
}
// 新增结果关系列表
export function addResultSymptom (data) {
  return requestHasToken({
    url: '/result/symptom/relation',
    method: 'post',
    data
  })
}
// 删除结果症状关系列表
export function deleteResultSymptom (id) {
  return requestHasToken({
    url: '/result/symptom/relation/' + id,
    method: 'delete'
  })
}
// 修改结果症状关系
export function updateResultSymptom (data) {
  return requestHasToken({
    url: '/result/symptom/relation',
    method: 'put',
    data
  })
}
// 获取缺乏症症状描述关系列表
export function getLackSymptomResultList (data) {
  return requestHasToken({
    url: '/ageusia/symptom/relation/list',
    // url: '/result/symptom/relation/list',
    method: 'post',
    data
  })
}
// 新增缺乏症症状描述关系
export function addLackSymptomResult (data) {
  return requestHasToken({
    url: '/ageusia/symptom/relation',
    method: 'post',
    data
  })
}
// 删除缺乏症症状描述关系
export function deleteLackSymptomResult (id) {
  return requestHasToken({
    url: '/ageusia/symptom/relation/' + id,
    method: 'delete'
  })
}
// 修改缺乏症症状描述关系
export function updateLackSymptomResult (data) {
  return requestHasToken({
    url: '/ageusia/symptom/relation',
    method: 'put',
    data
  })
}
// 查询转件评测价格
export function getTestPrice () {
  return requestHasToken({
    url: '/evaluation/price',
    method: 'get'
  })
}
// 修改专家评测价格
export function updateTestPrice (data) {
  return requestHasToken({
    url: '/evaluation/price',
    method: 'put',
    data
  })
}
// 新建z评分设置
export function addZPoint (data) {
  return requestHasToken({
    url: '/z/point',
    method: 'post',
    data
  })
}
// 修改z评分设置
export function updateZPoint (data) {
  return requestHasToken({
    url: '/z/point',
    method: 'put',
    data
  })
}
// 删除z评分设置
export function deleteZPoint (id) {
  return requestHasToken({
    url: '/z/point/' + id,
    method: 'delete'
  })
}
// 获取z评分设置列表
export function getZPointList (data) {
  return requestHasToken({
    url: '/z/point/list',
    method: 'post',
    data
  })
}
// 新建s表
export function addSChart (data) {
  return requestHasToken({
    url: '/s',
    method: 'post',
    data
  })
}
// s表当前版本
export function getCurrentSChartList (data) {
  return requestHasToken({
    url: '/s/list',
    method: 'post',
    data
  })
}
// s表历史版本
export function getHistorySChartList (data) {
  return requestHasToken({
    url: '/s/list/history',
    method: 'post',
    data
  })
}
// 查询s表问题列表
export function getSChartQuestion (id) {
  return requestHasToken({
    url: '/s/question/list/' + id,
    method: 'get'
  })
}
// 设置s表问题
export function addSChartQuestion (data) {
  return requestHasToken({
    url: '/s/question',
    method: 'post',
    data
  })
}
// 添加ai模板
export function addAITemplate (data) {
  return requestHasToken({
    url: '/ai/template',
    method: 'post',
    data
  })
}
// 查询ai模板
export function aiTemplateList (data) {
  return requestHasToken({
    url: '/ai/template/list',
    method: 'post',
    data
  })
}
// 新建调查问卷
export function addPaper (data) {
  return requestHasToken({
    url: '/questionnaire',
    method: 'post',
    data
  })
}
// 调查问卷模板查询
export function getPaperList (data) {
  return requestHasToken({
    url: '/questionnaire/list',
    method: 'post',
    data
  })
}
// 获取问卷的问题列表
export function getPaperQuestion (id) {
  return requestHasToken({
    url: '/questionnaire/label/questions/' + id,
    method: 'get'
  })
}
// 查询问卷调查的详情
export function getOnePaper (id) {
  return requestHasToken({
    url: '/questionnaire/' + id,
    method: 'get'
  })
}
// 问卷保存基本信息的更新
export function updateOnePaper (data) {
  return requestHasToken({
    url: '/questionnaire',
    method: 'put',
    data
  })
}
// 更新问卷的题目
export function setPaperQuestion (data) {
  return requestHasToken({
    url: '/questionnaire/label/question',
    method: 'post',
    data
  })
}
// 批量上传
export function uploadExcel (data) {
  return requestHasToken({
    url: '/batch/upload/excel',
    method: 'post',
    data
  })
}
// 微信用户列表
export function getWecharUserList (data) {
  return requestHasToken({
    url: '/wechat/user/list',
    method: 'post',
    data
  })
}
// 批量新增结果症状描述关系列表
export function addResultSymptomList (data) {
  return requestHasToken({
    url: '/result/symptom/relation/batch',
    method: 'post',
    data
  })
};
// 批量新增缺乏症症状描述关系列表
export function addLackSymptomResultList (data) {
  return requestHasToken({
    url: '/ageusia/symptom/relation/batch',
    method: 'post',
    data
  })
};
// 微信成员列表
export function getRelativeList (id) {
  return requestHasToken({
    url: '/wechat/member/list/' + id,
    method: 'get'
  })
};
// 获取用户的消费记录列表
export function getConsumeList (data) {
  return requestHasToken({
    url: '/wechat/user/trade/list',
    method: 'post',
    data
  })
};
// 成员健康档案历史记录
export function getFileHistoryList (data) {
  return requestHasToken({
    url: '/member/health/records/list',
    method: 'post',
    data
  })
};
// 成员健康档案详情
export function getFileInfo (id) {
  return requestHasToken({
    url: '/member/health/records/' + id,
    method: 'get'
  })
};
// 按健康档案查询图片
export function getImgsByRecordId (data) {
  return requestHasToken({
    url: '/wechat/member/pics',
    method: 'post',
    data
  })
};
// 用户消费统计
export function userConsumeAnalyze (data) {
  return requestHasToken({
    url: '/wechat/user/trade/statistics/list',
    method: 'post',
    data
  })
};
// 收支流水列表
export function incomeList (data) {
  return requestHasToken({
    url: '/platform/daily/trade/statistics/list',
    method: 'post',
    data
  })
};
// 按照成员查询上传图片
export function findImgByRemember (data) {
  return requestHasToken({
    url: '/wechat/member/pic/list',
    method: 'post',
    data
  })
};
// 成员上传图片统计
export function ImgStatistics (data) {
  return requestHasToken({
    url: '/wechat/member/pic/statistics/list',
    method: 'post',
    data
  })
};
// 新增bmi/身高判断
export function addBmiOrHeight (data) {
  return requestHasToken({
    url: '/bmi',
    method: 'post',
    data
  })
};
// 删除bmi/身高
export function deleteBmiOrHeight (id) {
  return requestHasToken({
    url: '/bmi/' + id,
    method: 'delete'
  })
};
// 修改bmi/身高
export function updateBmiOrHeight (data) {
  return requestHasToken({
    url: '/bmi',
    method: 'put',
    data
  })
};
// bmi/身高列表
export function getBmiOrHeightList (data) {
  return requestHasToken({
    url: '/bmi/list',
    method: 'post',
    data
  })
};
// 新增健康食谱食物
export function addDietFood (data) {
  return requestHasToken({
    url: '/food',
    method: 'post',
    data
  })
};
// 删除食物
export function deleteDietFood (id) {
  return requestHasToken({
    url: '/food/' + id,
    method: 'delete'
  })
};
// 修改食物
export function updateDietFood (data) {
  return requestHasToken({
    url: '/food',
    method: 'put',
    data
  })
};
// 食物列表
export function getDietFoodList (data) {
  return requestHasToken({
    url: '/food/list',
    method: 'post',
    data
  })
};
// 获取销售员列表
export function getSaleManList (data) {
  return requestHasToken({
    url: '/salesman/list',
    method: 'post',
    data
  })
};
// 查看推广人员的推广信息
export function getSaledList (id) {
  return requestHasToken({
    url: '/salesmanuser/' + id,
    method: 'get'
  })
};
// 添加疫苗
export function addVaccine (vaccine) {
  return requestHasToken({
    url: '/vaccine/insert',
    method: 'post',
    data: vaccine
  })
};
// 疫苗列表
export function getVaccineList (data) {
  return requestHasToken({
    url: '/vaccine/list',
    method: 'post',
    data
  })
};
// 删除疫苗
export function deleteVaccine (id) {
  return requestHasToken({
    url: '/vaccine/delete/' + id,
    method: 'delete'
  })
};
// 修改疫苗
export function updateVaccine (vaccine) {
  return requestHasToken({
    url: '/vaccine/update',
    method: 'put',
    data: vaccine
  })
};
// 获取体温打卡记录
export function getAllTemperature (data) {
  return requestHasToken({
    url: '/temperature/nomemberid/list',
    method: 'post',
    data
  })
};
// 推广信息分组
export function getSaleGroupByRemark (data) {
  return requestHasToken({
    url: '/salesman/group',
    method: 'post',
    data
  })
};
// 获取推广分组详细列表
export function getSaleGroupList (data) {
  return requestHasToken({
    url: '/salesmanuser/list',
    method: 'post',
    data
  })
};
export function getOldSaleList (data) {
  return requestHasToken({
    url: '/salesmanold/list',
    method: 'post',
    data
  })
};
// 添加测评结果模板
export function addResultTemplate (template) {
  return requestHasToken({
    url: '/resultTemplate/add',
    method: 'post',
    data: template
  })
};
// 修改推广二维码地理信息
export function updateQRLocation (location) {
  return requestHasToken({
    url: '/saleqr/update/three',
    method: 'put',
    data: location
  })
};
// 获取所有学校
export function getAllSchool () {
  return requestHasToken({
    url: '/school/name',
    method: 'get'
  })
};
// 根据学校查所有年级
export function getGradesBySchoolName (schoolName) {
  return requestHasToken({
    url: '/garde/name',
    method: 'post',
    data: {
      name: schoolName
    }
  })
};
// 根据学校和年级查询所有班级
export function getClassBySchoolAndGrade (schoolName, gradeName) {
  return requestHasToken({
    url: '/class/name',
    method: 'post',
    data: {
      name: gradeName,
      schoolName: schoolName
    }
  })
};
// 查询学校统计信息
export function getSchoolStatisticsInfo (searchData) {
  return requestHasToken({
    url: '/statistics',
    // url: '/test/map/statistics',
    method: 'post',
    data: searchData
  })
};
// 体温打卡统计
export function getTemperatureStatistics (search) {
  return requestHasToken({
    url: '/temperature/statistics',
    method: 'post',
    data: search
  })
};
// 获取家庭
export function getFamilyList (openid) {
  return requestHasToken({
    url: '/wechat/home/user',
    method: 'post',
    data: {
      userId: openid
    }
  })
};
// 修改s表
export function updateSChart (chart = {}) {
  return requestHasToken({
    url: '/s',
    method: 'put',
    data: chart
  })
};
// 查询心理健康表
export function getMentalList (data) {
  return requestHasToken({
    url: '/tbpsychologytitle/queryList',
    method: 'post',
    data
  })
};
// 删除心理健康表
export function deleteMentalChart (mentalId) {
  return requestHasToken({
    url: '/tbpsychologytitle/delete?psychologyTitleId=' + mentalId,
    method: 'delete'
  })
};
// 添加心理健康表
export function addMental (mental) {
  return requestHasToken({
    url: '/tbpsychologytitle/add',
    method: 'post',
    data: mental
  })
};
// 编辑心理健康表
export function editMental (mental) {
  return requestHasToken({
    url: '/tbpsychologytitle/update',
    method: 'put',
    data: mental
  })
};
// 查询心理健康题库
export function getMentalQuestion (data) {
  return requestHasToken({
    url: '/tbmentalquestionbank/queryPage',
    method: 'post',
    data
  })
};
// 查询心理健康题目不分页
export function getAllMentalQuestion () {
  return requestHasToken({
    url: '/tbmentalquestionbank/queryList',
    method: 'get'
  })
};
// 新增心理健康题目
export function addMentalQuestion (question) {
  return requestHasToken({
    url: '/tbmentalquestionbank/add',
    method: 'post',
    data: question
  })
};
// 删除心理健康题目
export function deleteMentalQuestion (questionId) {
  return requestHasToken({
    url: '/tbmentalquestionbank/delete?id=' + questionId,
    method: 'delete'
  })
};
// 修改心理健康题目
export function updateMentalQuestion (question) {
  return requestHasToken({
    url: '/tbmentalquestionbank/update',
    method: 'put',
    data: question
  })
};
// 查询心理健康表题目
export function getQuestionByMentalId (mentalId, data) {
  return requestHasToken({
    url: '/TbMentalMiddle/queryPsychologyTitleId/' + mentalId,
    method: 'post',
    data
  })
};
// 关联心理健康测试表和题目
export function addQuestion2Mental (data) {
  return  requestHasToken({
    url: '/TbMentalMiddle/addTbMentalMiddle',
    method: 'post',
    data
  })
};
// 查询心理健康测试表不分页
export function getAllMentalChart () {
  return requestHasToken({
    url: '/tbpsychologytitle/queryAll',
    method: 'get',
  })
};
// 修改心理健康测试表题目状态
export function changeMentalQuestionStatus (data) {
  return requestHasToken({
    url: '/TbMentalMiddle/updateTbMentalMiddle',
    method: 'put',
    data
  })
};
// 添加心理健康规则
export function addMentalRule (rule) {
  return requestHasToken({
    url: '/tbpsychologicalrules/add',
    method: 'post',
    data: rule
  })
};
// 分页查询心理规则
export function getMentalRuleList (query) {
  return requestHasToken({
    url: '/tbpsychologicalrules/queryPage',
    method: 'post',
    data: query
  })
};
// 修改心理规则
export function updateMentalRule (rule) {
  return requestHasToken({
    url: '/tbpsychologicalrules/update',
    method: 'put',
    data: rule
  })
};
// 删除心理规则
export function deleteMentalRule (ruleId) {
  return requestHasToken({
    url: '/tbpsychologicalrules/delete?id=' + ruleId,
    method: 'delete'
  })
};
// 查询心理评测答案设置
export function getMentalAnswer (query) {
  return requestHasToken({
    url: '/tbpsychologicalscore/queryPage',
    method: 'post',
    data: query
  })
};
// 添加心理评测答案设置
export function addMentalAnswer (answer) {
  return requestHasToken({
    url: '/tbpsychologicalscore/add',
    method: 'post',
    data: answer
  })
};
// 删除心理评测答案设置
export function deleteMentalAnswer (answerId) {
  return requestHasToken({
    url: '/tbpsychologicalscore/delete?id=' + answerId,
    method: 'delete'
  })
};
// 修改心理测评答案设置
export function updateMentalAnswer (mentalAnswer) {
  return requestHasToken({
    url: '/tbpsychologicalscore/update',
    method: 'put',
    data: mentalAnswer
  })
};
// 不分页查询心理规则
export function getAllMentalRule () {
  return requestHasToken({
    url: '/tbpsychologicalrules/queryList',
    method: 'get'
  })
};
// 添加知识
export function addKonwledge (knowledge) {
  return requestHasToken({
    url: '/TbKnowledge/addTbKnowledge',
    method: 'post',
    data: knowledge
  })
};
// 添加权限
export function addAuthority (authority) {
  return requestHasToken({
    url: '/TbUserPermission/addTbUserPermission',
    method: 'post',
    data: authority
  })
};
// 修改权限
export function updateAuthority (authority) {
  return requestHasToken({
    url: '/TbUserPermission/updateTbUserPermission',
    method: 'put',
    data: authority
  })
};
// 删除权限
export function deleteAuthority (authorityId) {
  return requestHasToken({
    url: '/TbUserPermission/deleteTbUserPermission/' + authorityId,
    method:'delete'
  })
};
// 分页查询权限
export function getAuthorityByPage (query) {
  return requestHasToken({
    url: '/TbUserPermission/getTbUserPermissionPage',
    method: 'post',
    data: query
  })
};
// 根据权限类型查询
export function getAuthorityByType (type) {
  return requestHasToken({
    url: '/TbUserPermission/queryUserPermissionType',
    method: 'post',
    data: {
      userPermissionType: type
    }
  })
};
// 不分页查询所有权限
export function getAllAuthority () {
  return requestHasToken({
    url: '/TbUserPermission/getTbUserPermissionList',
    method: 'get'
  })
};
// 添加角色
export function addRole (role) {
  return requestHasToken({
    url: '/TbUserRole/addTbUserRole',
    method: 'post',
    data: role
  })
};
// 修改角色
export function updateRole (role) {
  return  requestHasToken({
    url: '/TbUserRole/updateTbUserRole',
    method: 'put',
    data: role
  })
};
// 删除角色
export function deleteRole (roleId) {
  return requestHasToken({
    url: '/TbUserRole/deleteTbUserRole/' + roleId,
    method: 'delete'
  })
};
// 分页查询用户角色
export function getRoleListByPage (query) {
  return requestHasToken({
    url: '/TbUserRole/queryTbUserRolePage',
    method: 'post',
    data: query
  })
};
// 设置权限
export function setAuthority (authority) {
  return requestHasToken({
    url: '/TbUserRolePermission/addTbUserRolePermission',
    method: 'post',
    data: authority
  })
};
// 根据角色id查询权限
export function getAuthByRoleId (roleId) {
  return requestHasToken({
    url: '/TbUserRolePermission/queryTbUserRolePermissionRoleId',
    method: 'post',
    data: {
      userRoleId: roleId
    }
  })
};
// 不分页查询角色
export function getAllRoleList () {
  return requestHasToken({
    url: '/TbUserRole/queryTbUserRoleList',
    method: 'get'
  })
}
//#region 新的管理员管理
// 添加用户
export function addAdminUserV2 (admin) {
  return requestHasToken({
    url: '/TbUser/addTbUser',
    method: 'post',
    data: admin
  })
};
// 分页查询用户
export function getAdminUserListByPageV2 (query) {
  return requestHasToken({
    url: '/TbUser/getTbUserPage',
    method: 'post',
    data: query
  })
};
// 启用/禁用用户
export function changeAdminUserStatusV2 (userId, enable) {
  return requestHasToken({
    url: '/TbUser/updateEnable',
    method: 'put',
    data: {
      userId,
      enable
    }
  })
};
// 重置管理员的登录密码
export function resetLoginPassword (userId) {
  return requestHasToken({
    url: '/TbUser/updateResetPassword',
    method: 'put',
    data: {
      userId
    }
  })
};
// 修改管理员密码
export function changeAdminPassword (admin) {
  return requestHasToken({
    url: '/TbUser/updateTbUser',
    method: 'put',
    data: admin
  })
}
//#endregion
// 添加类目
export function addCategory (category) {
  return requestHasToken({
    url: '/category/createCategory',
    method: 'post',
    data: category
  })
};
// 修改类目
export function updateCategory (category) {
  return requestHasToken({
    url: '/TbChartCategory/updateTbChartCategory',
    method: 'put',
    data: category
  })
};
// 删除类目
export function deleteCategory (categoryId) {
  return requestHasToken({
    url: `/TbChartCategory/deletechartCategoryId/${categoryId}`,
    method: 'delete'
  })
};
// 不分页查询类目列表
export function getAllCategory () {
  return requestHasToken({
    url: '/category/queryAll',
    method: 'get'
  })
};
// 新的登录接口
export function loginV2 (loginInfo) {
  return requestHasToken({
    url: '/auth/newUser/login',
    method: 'post',
    data: loginInfo
  })
};
// 修改密码
export function updatePasswordV2 (user) {
  return requestHasToken({
    url: '/TbUser/updateTbUser',
    method: 'put',
    data: user
  })
};
// 从心理测试表中删除题目
export function deleteQuestionFromMental (qId) {
  return requestHasToken({
    url: '/TbMentalMiddle/deleteTbMentalMiddle/' + qId,
    method: 'delete'
  })
};
// 根据心理测试表id查询题目
export function getQuestionListByMentalId (mentalId) {
  return requestHasToken({
    url: '/TbMentalMiddle/queryTbMentalMiddle/' + mentalId,
    method: 'get'
  })
};
// 添加心理类目
export function addMentalCategory (category) {
  return requestHasToken({
    url: '/tbPsychologyCategory/addTbPsychologyCategory',
    method: 'post',
    data: category
  })
};
// 修改心理类目
export function updateMentalCategory (category) {
  return requestHasToken({
    url: '/tbPsychologyCategory/updateTbPsychologyCategory',
    method: 'put',
    data: category
  })
};
// 删除心理类目
export function deleteMentalCategory (categoryId) {
  return requestHasToken({
    url: '/tbPsychologyCategory/deleteById/' + categoryId,
    method: 'delete'
  })
};
// 分页查询心理类目
export function getMentalCategoryByPage (query) {
  return requestHasToken({
    url: '/tbPsychologyCategory/tbPsychologyCategoryPage',
    method: 'post',
    data: query
  })
};
// 查询所有心理类目
export function getAllMentalCategory () {
  return request({
    url: '/auth/tbPsychologyCategory/queryAll',
    method: 'get'
  })
};
// 分页查询心理标题
export function getMentalChartByPage (data) {
  return requestHasToken({
    url: '/tbpsychologytitle/queryList',
    method: 'post',
    data
  })
};
// 查询成员心理测评记录
export const getMentalRecordByMId = mId => {
  return requestHasToken({
    url: `/member/queryPsychology/${mId}`,
    method: 'get'
  })
};
// 查询答题记录
export const getQuestionRecord = order => {
  return requestHasToken({
    url: `/TbUserRecordPsychology/queryParticulars/${order}`,
    method: 'get'
  })
};
// 上传多个题目
export const uploadMultipleQuestion = list => {
  return requestHasToken({
    url: '/tbmentalquestionbank/multiple_add',
    method: 'post',
    data: list
  })
};
// 心理统计
export const mentalStatistics = query => {
  return requestHasToken({
    url: '/tbPsychologicalStatistic/queryInformation',
    method: 'post',
    data: query
  })
};
// 心理统计异常人数
export const getMentalBadNum = query => {
  return requestHasToken({
    url: '/tbPsychologicalStatistic/queryPsychologyTitle',
    method: 'post',
    data: query
  })
};
// 获取心理学校
export const getMentalSchool = () => {
  return requestHasToken({
    url: '/tbPsychologicalStatistic/querySchoolName',
    method: 'get'
  })
};
// 获取心理年级
export const getMentalGrade = school => {
  return requestHasToken({
    url: `/tbPsychologicalStatistic/getAllGradeName/${school}`,
    method: 'get'
  })
};
// 获取心理班级
export const getMentalClass = (school, grade) => {
  return requestHasToken({
    url: '/tbPsychologicalStatistic/getAllClassName',
    method: 'post',
    data: {
      schoolName: school,
      statisticName: grade
    }
  })
};
// 获取心理统计名单
export const getMentalNameList = (schoolName, sno = null) => {
  return requestHasToken({
    url: '/TbUserRecordPsychology/queryResult',
    method: 'post',
    data: {
      schoolName, sno
    }
  })
}

